gtk_frame_init (GtkFrame *frame)
{
GtkFramePrivate *priv;
+ GtkStyleContext *context;
frame->priv = G_TYPE_INSTANCE_GET_PRIVATE (frame,
GTK_TYPE_FRAME,
priv->shadow_type = GTK_SHADOW_ETCHED_IN;
priv->label_xalign = 0.0;
priv->label_yalign = 0.5;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (frame));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
}
static void
state = gtk_widget_get_state_flags (widget);
gtk_widget_get_allocation (widget, &allocation);
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
-
gtk_style_context_get_padding (context, state, &padding);
x = priv->child_allocation.x - allocation.x - padding.left;
gtk_render_frame (context, cr, x, y, width, height);
}
- gtk_style_context_restore (context);
-
GTK_WIDGET_CLASS (gtk_frame_parent_class)->draw (widget, cr);
return FALSE;
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
-
gtk_style_context_get_padding (context, state, &padding);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
priv->label_allocation.height = height;
gtk_widget_size_allocate (priv->label_widget, &priv->label_allocation);
-
- gtk_style_context_restore (context);
}
}
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
-
gtk_style_context_get_padding (context, state, &padding);
gtk_widget_get_allocation (widget, &allocation);
child_allocation->x += allocation.x;
child_allocation->y += allocation.y;
-
- gtk_style_context_restore (context);
}
static void
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
gtk_style_context_get_padding (context, state, &padding);
if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
if (natural_size)
*natural_size = natural;
-
- gtk_style_context_restore (context);
}
static void
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
gtk_style_context_get_padding (context, state, &padding);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (natural_height)
*natural_height = natural;
-
- gtk_style_context_restore (context);
}
static void